const {
  DataTypes
} = require('sequelize');

module.exports = sequelize => {
  const attributes = {
    id: {
      type: DataTypes.INTEGER,
      allowNull: false,

      primaryKey: true,
      autoIncrement: true,
      comment: "ID",
      field: "id"
    },
    name: {
      type: DataTypes.STRING(20),
      allowNull: false,
      defaultValue:  '',
      primaryKey: false,
      autoIncrement: false,
      comment: "名称",
      field: "name"
    },
    address: {
      type: DataTypes.STRING(255),
      allowNull: false,
      defaultValue:  '',
      primaryKey: false,
      autoIncrement: false,
      comment: "地址",
      field: "address"
    },
    code: {
      type: DataTypes.STRING(255),
      allowNull: false,
      defaultValue:  '',
      primaryKey: false,
      autoIncrement: false,
      comment: "机构编码",
      field: "code"
    },
    qualify: {
      type: DataTypes.STRING(255),
      allowNull: false,
      defaultValue:  '',
      primaryKey: false,
      autoIncrement: false,
      comment: "相关证件",
      field: "qualify"
    },
    report: {
      type: DataTypes.STRING(255),
      allowNull: false,
      defaultValue:  '',
      primaryKey: false,
      autoIncrement: false,
      comment: "环境信息报告",
      field: "report"
    },
    unit_code: {
      type: DataTypes.STRING(255),
      allowNull: false,
      defaultValue:  '',
      primaryKey: false,
      autoIncrement: false,
      comment: "养殖单元",
      field: "unit_code"
    },
    createdAt: {
      type: DataTypes.DATE,
      allowNull: true,

      primaryKey: false,
      autoIncrement: false,
      comment: null,
      field: "createdAt"
    },
    updatedAt: {
      type: DataTypes.DATE,
      allowNull: true,

      primaryKey: false,
      autoIncrement: false,
      comment: null,
      field: "updatedAt"
    },
    deletedAt: {
      type: DataTypes.DATE,
      allowNull: true,

      primaryKey: false,
      autoIncrement: false,
      comment: null,
      field: "deletedAt"
    }
  };
  const options = {
    tableName: "farm_baseinfo",
    comment: "",
    indexes: [],
    timestamps: true,
    paranoid: true
  };
  const FarmBaseinfoModel = sequelize.define("farm_baseinfo_model", attributes, options);
  return FarmBaseinfoModel;
};